<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GdaXaTransaction: GNOME Data Access 5 manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GNOME Data Access 5 manual">
<link rel="up" href="connection.html" title="Connections &amp; commands">
<link rel="prev" href="GdaTransactionStatus.html" title="GdaTransactionStatus">
<link rel="next" href="virtual_connection.html" title="Virtual connections">
<meta name="generator" content="GTK-Doc V1.32 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#libgda-5.0-GdaXaTransaction.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="connection.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GdaTransactionStatus.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="virtual_connection.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libgda-5.0-GdaXaTransaction"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgda-5.0-GdaXaTransaction.top_of_page"></a>GdaXaTransaction</span></h2>
<p>GdaXaTransaction — Distributed transaction manager</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libgda-5.0-GdaXaTransaction.stability-level"></a><h2>Stability Level</h2>
<a href="http://foldoc.org/Stable"><span class="acronym">Stable</span></a>, unless otherwise indicated
</div>
<div class="refsect1">
<a name="libgda-5.0-GdaXaTransaction.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="returnvalue">GdaXaTransaction</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-new" title="gda_xa_transaction_new ()">gda_xa_transaction_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-register-connection" title="gda_xa_transaction_register_connection ()">gda_xa_transaction_register_connection</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-unregister-connection" title="gda_xa_transaction_unregister_connection ()">gda_xa_transaction_unregister_connection</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-begin" title="gda_xa_transaction_begin ()">gda_xa_transaction_begin</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-commit" title="gda_xa_transaction_commit ()">gda_xa_transaction_commit</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-rollback" title="gda_xa_transaction_rollback ()">gda_xa_transaction_rollback</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-commit-recovered" title="gda_xa_transaction_commit_recovered ()">gda_xa_transaction_commit_recovered</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-id-to-string" title="gda_xa_transaction_id_to_string ()">gda_xa_transaction_id_to_string</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="returnvalue">GdaXaTransactionId</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-string-to-id" title="gda_xa_transaction_string_to_id ()">gda_xa_transaction_string_to_id</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libgda-5.0-GdaXaTransaction.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction">GdaXaTransaction</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransactionError" title="enum GdaXaTransactionError">GdaXaTransactionError</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId">GdaXaTransactionId</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libgda-5.0-GdaXaTransaction.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;virtual/gda-ldap-connection.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="libgda-5.0-GdaXaTransaction.description"></a><h2>Description</h2>
<p>The <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object acts as a distributed transaction manager: to make sure local transactions on several
connections (to possibly different databases and database types) either all succeed or all fail. For more information,
see the X/Open CAE document Distributed Transaction Processing: The XA Specification. 
This document is published by The Open Group and available at </p>
<a class="ulink" href="http://www.opengroup.org/public/pubs/catalog/c193.htm" target="_top">http://www.opengroup.org/public/pubs/catalog/c193.htm</a>.
<p>The two phases commit protocol is implemented during the execution of a distributed transaction: modifications
made on any connection are first <span class="emphasis"><em>prepared</em></span> (which means that they are store in the database), and
if that phase succeeded for all the involved connections, then the <span class="emphasis"><em>commit</em></span> phase is executed
(where all the data previously stored during the <span class="emphasis"><em>prepare</em></span> phase are actually committed).
That second phase may actually fail, but the distributed transaction will still be considered as successfull
as the data stored during the <span class="emphasis"><em>prepare</em></span> phase can be committed afterwards.</p>
<p>A distributed transaction involves the following steps:</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><p>Create a <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</p></li>
<li class="listitem"><p>Register the connections which will be part of the distributed transaction with that object
using <a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-register-connection" title="gda_xa_transaction_register_connection ()"><code class="function">gda_xa_transaction_register_connection()</code></a></p></li>
<li class="listitem"><p>Beging the distributed transaction using <a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-begin" title="gda_xa_transaction_begin ()"><code class="function">gda_xa_transaction_begin()</code></a></p></li>
<li class="listitem"><p>Work individually on each connection as normally (make modifications)</p></li>
<li class="listitem"><p>Commit the distributed transaction using <a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-commit" title="gda_xa_transaction_commit ()"><code class="function">gda_xa_transaction_commit()</code></a></p></li>
<li class="listitem"><p>Discard the <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object using <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a></p></li>
</ol></div>
</div>
<div class="refsect1">
<a name="libgda-5.0-GdaXaTransaction.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gda-xa-transaction-new"></a><h3>gda_xa_transaction_new ()</h3>
<pre class="programlisting"><a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="returnvalue">GdaXaTransaction</span></a> *
gda_xa_transaction_new (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> format</code></em>,
                        <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *global_transaction_id</code></em>);</pre>
<p>Creates a new <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object, which will control the process of
performing a distributed transaction across several connections.</p>
<div class="refsect3">
<a name="gda-xa-transaction-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a format ID</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>global_transaction_id</p></td>
<td class="parameter_description"><p>the global transaction ID</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gda-xa-transaction-new.returns"></a><h4>Returns</h4>
<p>the newly created object. </p>
<p><span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-register-connection"></a><h3>gda_xa_transaction_register_connection ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gda_xa_transaction_register_connection
                               (<em class="parameter"><code><a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
                                <em class="parameter"><code><a class="link" href="GdaConnection.html" title="GdaConnection"><span class="type">GdaConnection</span></a> *cnc</code></em>,
                                <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *branch</code></em>,
                                <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Registers <em class="parameter"><code>cnc</code></em>
 to be used by <em class="parameter"><code>xa_trans</code></em>
 to create a distributed transaction.</p>
<p>Note: any <a class="link" href="GdaConnection.html" title="GdaConnection"><span class="type">GdaConnection</span></a> object can only be registered with at most one <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object; also
some connections may not be registered at all with a <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object because the database
provider being used does not support it.</p>
<div class="refsect3">
<a name="gda-xa-transaction-register-connection.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>xa_trans</p></td>
<td class="parameter_description"><p>a <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cnc</p></td>
<td class="parameter_description"><p>the connection to add to <em class="parameter"><code>xa_trans</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>branch</p></td>
<td class="parameter_description"><p>the branch qualifier</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a place to store errors, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gda-xa-transaction-register-connection.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if no error occurred</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-unregister-connection"></a><h3>gda_xa_transaction_unregister_connection ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gda_xa_transaction_unregister_connection
                               (<em class="parameter"><code><a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
                                <em class="parameter"><code><a class="link" href="GdaConnection.html" title="GdaConnection"><span class="type">GdaConnection</span></a> *cnc</code></em>);</pre>
<p>Unregisters <em class="parameter"><code>cnc</code></em>
 to be used by <em class="parameter"><code>xa_trans</code></em>
 to create a distributed transaction. This is
the opposite of <a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-register-connection" title="gda_xa_transaction_register_connection ()"><code class="function">gda_xa_transaction_register_connection()</code></a>.</p>
<div class="refsect3">
<a name="gda-xa-transaction-unregister-connection.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>xa_trans</p></td>
<td class="parameter_description"><p>a <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cnc</p></td>
<td class="parameter_description"><p>the connection to add to <em class="parameter"><code>xa_trans</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-begin"></a><h3>gda_xa_transaction_begin ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gda_xa_transaction_begin (<em class="parameter"><code><a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
                          <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Begins a distributed transaction (managed by <em class="parameter"><code>xa_trans</code></em>
). Please note that this phase may fail
for some connections if a (normal) transaction is already started (this depends on the database
provider being used), so it's better to avoid starting any (normal) transaction on any of the
connections registered with <em class="parameter"><code>xa_trans</code></em>
.</p>
<div class="refsect3">
<a name="gda-xa-transaction-begin.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>xa_trans</p></td>
<td class="parameter_description"><p>a <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a place to store errors, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gda-xa-transaction-begin.returns"></a><h4>Returns</h4>
<p> TRUE if no error occurred</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-commit"></a><h3>gda_xa_transaction_commit ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gda_xa_transaction_commit (<em class="parameter"><code><a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
                           <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> **cnc_to_recover</code></em>,
                           <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Commits a distributed transaction (managed by <em class="parameter"><code>xa_trans</code></em>
). The commit is composed of two phases:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>a PREPARE phase where all the connections are required to store their transaction data to a 
    permanent place (to be able to complete the commit should a problem occur afterwards)</p></li>
<li class="listitem"><p>a COMMIT phase where the transaction data is actually written to the database</p></li>
</ul></div>
<p>If the PREPARE phase fails for any of the connection registered with <em class="parameter"><code>xa_trans</code></em>
, then the distributed commit
fails and FALSE is returned. During the COMMIT phase, some commit may actually fail but the transaction can
still be completed because the PREPARE phase succeeded (through the recover method).</p>
<div class="refsect3">
<a name="gda-xa-transaction-commit.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>xa_trans</p></td>
<td class="parameter_description"><p>a <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cnc_to_recover</p></td>
<td class="parameter_description"><p>a place to store the list of connections for which the commit phase failed, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> Gda.Connection][<a href="http://foldoc.org/out%20callee-allocates"><span class="acronym">out callee-allocates</span></a>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a place to store errors, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gda-xa-transaction-commit.returns"></a><h4>Returns</h4>
<p> TRUE if no error occurred (there may be some connections to recover, though)</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-rollback"></a><h3>gda_xa_transaction_rollback ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gda_xa_transaction_rollback (<em class="parameter"><code><a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
                             <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Cancels a distributed transaction (managed by <em class="parameter"><code>xa_trans</code></em>
).</p>
<div class="refsect3">
<a name="gda-xa-transaction-rollback.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>xa_trans</p></td>
<td class="parameter_description"><p>a <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a place to store errors, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gda-xa-transaction-rollback.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if no error occurred</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-commit-recovered"></a><h3>gda_xa_transaction_commit_recovered ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gda_xa_transaction_commit_recovered (<em class="parameter"><code><a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> *xa_trans</code></em>,
                                     <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> **cnc_to_recover</code></em>,
                                     <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Tries to commit the data prepared but which failed to commit (see <a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-commit" title="gda_xa_transaction_commit ()"><code class="function">gda_xa_transaction_commit()</code></a>). This
method allows one to terminate a distributed transaction which succeeded but for which some
connections needed to be recovered.</p>
<div class="refsect3">
<a name="gda-xa-transaction-commit-recovered.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>xa_trans</p></td>
<td class="parameter_description"><p>a <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransaction" title="struct GdaXaTransaction"><span class="type">GdaXaTransaction</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cnc_to_recover</p></td>
<td class="parameter_description"><p>a place to store the list of connections for which the there were data to recover and which failed to be actually committed, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> Gda.Connection][<a href="http://foldoc.org/out%20callee-allocates"><span class="acronym">out callee-allocates</span></a>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a place to store errors, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gda-xa-transaction-commit-recovered.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if all the data which was still uncommitted has been committed</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-id-to-string"></a><h3>gda_xa_transaction_id_to_string ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
gda_xa_transaction_id_to_string (<em class="parameter"><code>const <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="type">GdaXaTransactionId</span></a> *xid</code></em>);</pre>
<p>Creates a string representation of <em class="parameter"><code>xid</code></em>
, in the format &lt;gtrid&gt;,&lt;bqual&gt;,&lt;formatID&gt; the 
&lt;gtrid&gt; and &lt;bqual&gt; strings contain alphanumeric characters, and non alphanumeric characters
are converted to "<code class="literal">ab</code>" where ab is the hexadecimal representation of the character.</p>
<div class="refsect3">
<a name="gda-xa-transaction-id-to-string.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>xid</p></td>
<td class="parameter_description"><p>a <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="type">GdaXaTransactionId</span></a> pointer</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gda-xa-transaction-id-to-string.returns"></a><h4>Returns</h4>
<p>a new string representation of <em class="parameter"><code>xid</code></em>
. </p>
<p><span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gda-xa-transaction-string-to-id"></a><h3>gda_xa_transaction_string_to_id ()</h3>
<pre class="programlisting"><a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="returnvalue">GdaXaTransactionId</span></a> *
gda_xa_transaction_string_to_id (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *str</code></em>);</pre>
<p>Creates a new <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="type">GdaXaTransactionId</span></a> structure from its string representation, it's the opposite
of <a class="link" href="libgda-5.0-GdaXaTransaction.html#gda-xa-transaction-id-to-string" title="gda_xa_transaction_id_to_string ()"><code class="function">gda_xa_transaction_id_to_string()</code></a>.</p>
<p><span class="annotation">[<a href="http://foldoc.org/skip"><span class="acronym">skip</span></a>]</span></p>
<div class="refsect3">
<a name="gda-xa-transaction-string-to-id.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>a string representation of a <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="type">GdaXaTransactionId</span></a>, in the "gtrid,bqual,formatID" format</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gda-xa-transaction-string-to-id.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="libgda-5.0-GdaXaTransaction.html#GdaXaTransactionId" title="struct GdaXaTransactionId"><span class="type">GdaXaTransactionId</span></a> structure, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> in <em class="parameter"><code>str</code></em>
has a wrong format</p>
<p>Free-function: g_free</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="libgda-5.0-GdaXaTransaction.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GdaXaTransaction"></a><h3>struct GdaXaTransaction</h3>
<pre class="programlisting">struct GdaXaTransaction {
	GObject                  object;
	GdaXaTransactionPrivate *priv;
};
</pre>
</div>
<hr>
<div class="refsect2">
<a name="GdaXaTransactionError"></a><h3>enum GdaXaTransactionError</h3>
<div class="refsect3">
<a name="GdaXaTransactionError.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GDA-XA-TRANSACTION-ALREADY-REGISTERED-ERROR:CAPS"></a>GDA_XA_TRANSACTION_ALREADY_REGISTERED_ERROR</p></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GDA-XA-TRANSACTION-DTP-NOT-SUPPORTED-ERROR:CAPS"></a>GDA_XA_TRANSACTION_DTP_NOT_SUPPORTED_ERROR</p></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GDA-XA-TRANSACTION-CONNECTION-BRANCH-LENGTH-ERROR:CAPS"></a>GDA_XA_TRANSACTION_CONNECTION_BRANCH_LENGTH_ERROR</p></td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GdaXaTransactionId"></a><h3>struct GdaXaTransactionId</h3>
<pre class="programlisting">struct GdaXaTransactionId {
	guint32  format;
	gushort  gtrid_length;
	gushort  bqual_length;
	char     data [128];
};
</pre>
<div class="refsect3">
<a name="GdaXaTransactionId.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> <em class="structfield"><code><a name="GdaXaTransactionId.format"></a>format</code></em>;</p></td>
<td class="struct_member_description"><p>any number</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gushort"><span class="type">gushort</span></a> <em class="structfield"><code><a name="GdaXaTransactionId.gtrid-length"></a>gtrid_length</code></em>;</p></td>
<td class="struct_member_description"><p>number between 1 and 64</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gushort"><span class="type">gushort</span></a> <em class="structfield"><code><a name="GdaXaTransactionId.bqual-length"></a>bqual_length</code></em>;</p></td>
<td class="struct_member_description"><p>number between 1 and 64</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">char</span> <em class="structfield"><code><a name="GdaXaTransactionId.data"></a>data</code></em>[128];</p></td>
<td class="struct_member_description"> </td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32</div>
</body>
</html>